package org.ekstrabilet.game.logic;

import java.sql.Date;
import java.sql.Time;

public class Row {
	
	private String homeTeam;
	private String visitorTeam;
	private String stadium;
	private String city;
	private Date date;
	private Time time;

	public String getHomeTeam() {
		return homeTeam;
	}
	public void setHomeTeam(String homeTeam) {
		this.homeTeam = homeTeam;
	}
	public String getVisitorTeam() {
		return visitorTeam;
	}
	public void setVisitorTeam(String visitorTeam) {
		this.visitorTeam = visitorTeam;
	}
	public String getStadium() {
		return stadium;
	}
	public void setStadium(String stadium) {
		this.stadium = stadium;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public Time getTime() {
		return time;
	}
	public void setTime(Time time) {
		this.time = time;
	}
	
	public Object[] getObject() {
		return new Object[] {0, homeTeam, visitorTeam, stadium, city, date, time};
	}
	
	public boolean equals(Row r) {
		if(!homeTeam.equals(r.homeTeam)) return false;
		if(!visitorTeam.equals(r.visitorTeam)) return false;
		if(!stadium.equals(r.stadium)) return false;
		if(!city.equals(r.city)) return false;
		if(!date.equals(r.date)) return false;
		if(!time.equals(r.time)) return false;
		
		return true;
	}
	
	public boolean isComplete() {
		if(homeTeam == null || homeTeam.length() < 1) return false;
		if(visitorTeam == null || visitorTeam.length() < 1) return false;
		if(stadium == null || stadium.length() < 1) return false;
		if(city == null || city.length() < 1) return false;
		if(date == null) return false;
		if(time == null) return false;
		return true;
	}
}
